/***************************************************************************
 *            object_3d.h
 *
 *  Mon Aug 25 17:40:40 2008
 *  Copyright  2008  Tiago Falcão
 *  <tiago@tiagofalcao.com>
 ****************************************************************************/

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
 */
 
#ifndef OBJECT_3D_H
#define OBJECT_3D_H

#include "points.h"
#include <GL/gl.h>
#include <GL/glut.h>

typedef struct color{
float r,g,b,a;
} color_t;

typedef struct object_3d{
	unsigned short int selected;		// Indica se o objeto esta selecionado
	GLdouble size;						// Parametro de Tamanho do Objeto
	point_cart position;				// Posicao central do objeto
	color_t color;						// Cor do Objeto
	point_cart scale;					// Escalas X, Y e Z
	point_cart rotate;					// Rotacoes em X, Y e Z
	
	GLfloat ambient[4];					// Reflexao da Luz Ambiente
	GLfloat diffuse[4];					// Reflexao da Luz Difusa
	GLfloat specular[4];				// Reflexao da Luz Especular
	GLfloat shininess;					// Concentracao da Reflexao
	GLfloat emission[4];				// Reflexao da Luz Emissiva
	
	void (*display)(GLdouble);			// Funcao de Desenho do Obejto
	void (*display_selected)(GLdouble); // Func de Desenho do Objeto Selecionado

} object3d;		

// Esfera Simplificada
void simple_glutSolidSphere(GLdouble size);
void simple_glutWireSphere(GLdouble size);

// Desenha Objeto 3D
void obj3d_display(object3d * obj);

//Translacao em X
void obj3d_trans_x(object3d * obj,short int sign);
//Translacao em Y
void obj3d_trans_y(object3d * obj,short int sign);
//Translacao em Z
void obj3d_trans_z(object3d * obj,short int sign);

//Rotacao no eixo X
void obj3d_rot_x(object3d * obj,short int sign);
//Rotacao no eixo Y
void obj3d_rot_y(object3d * obj,short int sign);
//Rotacao no eixo Z
void obj3d_rot_z(object3d * obj,short int sign);

//Tamanho
void obj3d_size(object3d * obj,short int sign);

//Escala em X
void obj3d_scale_x(object3d * obj,short int sign);
//Escala em Y
void obj3d_scale_y(object3d * obj,short int sign);
//Escala em Z
void obj3d_scale_z(object3d * obj,short int sign);

#endif /* OBJECT_3D_H */

